<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <ul class="nav nav-tabs">
        <li class="active">
            <a href="#tab-general" data-toggle="tab" aria-expanded="false">基本信息</a>
        </li>
        <li class="">
            <a href="#tab-content" data-toggle="tab" aria-expanded="false">详情描述</a>
        </li>
        <li class="">
            <a href="#tab-images" data-toggle="tab" aria-expanded="false">图片信息</a>
        </li>
        <li class="">
            <a href="#tab-orther" data-toggle="tab" aria-expanded="false">其他信息</a>
        </li>
    </ul>
    <div class="tab-content" style="padding-top: 10px;">
        <div class="tab-pane active" id="tab-general">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text"
                        value="{$row.name|htmlentities}">
                </div>
            </div>
            <!-- <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('House_no')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-house_no" data-rule="required" class="form-control" name="row[house_no]" type="text" value="{$row.house_no|htmlentities}">
                </div>
            </div> -->
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Village_id')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-village_id" data-rule="required" data-source="xiluhouse/rent/village/index"
                        class="form-control selectpage" name="row[village_id]" type="text"
                        value="{$row.village_id|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-user_id" data-source="xiluhouse/user/user/index" data-field="nickname"
                        data-params='{"custom[userprofile.is_broker]":["in","1,2"]}' class="form-control selectpage"
                        name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
                </div>
            </div>
            <!-- <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Is_public')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">
                        {foreach name="isPublicList" item="vo"}
                        <label for="row[is_public]-{$key|htmlentities}"><input id="row[is_public]-{$key|htmlentities}"
                                name="row[is_public]" type="radio" value="{$key|htmlentities}" {in name="key"
                                value="$row.is_public" }checked{/in} /> {$vo|htmlentities}</label>
                        {/foreach}
                    </div>

                </div>
            </div> -->
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('State')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">
                        {foreach name="stateList" item="vo"}
                        <label for="row[state]-{$key|htmlentities}"><input id="row[state]-{$key|htmlentities}"
                                name="row[state]" type="radio" value="{$key|htmlentities}" {in name="key"
                                value="$row.state" }checked{/in} /> {$vo|htmlentities}</label>
                        {/foreach}
                    </div>

                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]"
                        type="number" value="{$row.price|htmlentities}">
                </div>
            </div>
            <!-- <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('House_type_id')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-house_type_id" data-rule="required" data-source="xiluhouse/house/housetype/index"
                        data-params='{"custom[status]":"normal"}' class="form-control selectpage"
                        name="row[house_type_id]" type="text" value="{$row.house_type_id|htmlentities}">
                </div>
            </div> -->
            {volist name="tag_type" id="vo"}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{$vo.name|htmlentities}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-house_tag_ids{$key|htmlentities}" data-rule=""
                        data-source="xiluhouse/house/housetag/index"
                        data-multiple="{$vo.multi_status == 1?'false':'true'}" class="form-control selectpage"
                        name="row[tag][{$vo.id|htmlentities}]" type="text" value="{$vo.selected_ids|htmlentities}">
                </div>
            </div>
            {/volist}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Space')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-space" class="form-control" name="row[space]" type="number"
                        value="{$row.space|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Room_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-room_num" class="form-control" name="row[room_num]" type="number"
                        value="{$row.room_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Ting_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-ting_num" class="form-control" name="row[ting_num]" type="number"
                        value="{$row.ting_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Wei_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-wei_num" class="form-control" name="row[wei_num]" type="number"
                        value="{$row.wei_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Face')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-face" class="form-control" name="row[face]" type="text"
                        value="{$row.face|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Floor_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-floor_num" class="form-control" name="row[floor_num]" type="number"
                        value="{$row.floor_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-weigh" class="form-control" name="row[weigh]" type="number"
                        value="{$row.weigh|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">
                        {foreach name="statusList" item="vo"}
                        <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}"
                                name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key"
                                value="$row.status" }checked{/in} /> {$vo|htmlentities}</label>
                        {/foreach}
                    </div>

                </div>
            </div>
        </div>
        <div class="tab-pane" id="tab-content">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <textarea id="c-content" class="form-control editor" rows="5" name="row[content]"
                        cols="50">{$row.content|htmlentities}</textarea>
                </div>
            </div>
        </div>
        <div class="tab-pane" id="tab-images">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-image" class="form-control" size="50" name="row[image]" type="text"
                            value="{$row.image|htmlentities}">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="plupload-image" class="btn btn-danger plupload"
                                    data-input-id="c-image"
                                    data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                    data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i>
                                    {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose"
                                    data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i
                                        class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-image"></span>
                    </div>
                    <ul class="row list-inline plupload-preview" id="p-image"></ul>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-images" class="form-control" size="50" name="row[images]" type="textarea"
                            value="{$row.images|htmlentities}">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="plupload-images" class="btn btn-danger plupload"
                                    data-input-id="c-images"
                                    data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                    data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i>
                                    {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose"
                                    data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i
                                        class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-images"></span>
                    </div>
                    <ul class="row list-inline plupload-preview" id="p-images"></ul>
                </div>
            </div>
        </div>
        <div class="tab-pane" id="tab-orther">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Building_descript')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <dl class="fieldlist" data-name="row[building_descript]" data-template="building_descripttpl">
                        <dd>
                            <ins>名称</ins>
                            <ins>值</ins>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>
                                追加</a>
                        </dd>
                        <textarea name="row[building_descript]" class="form-control hide" cols="50"
                            rows="5">{$row.building_descript|htmlentities}</textarea>
                    </dl>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Cosult_tel')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-cosult_tel" class="form-control" name="row[cosult_tel]" type="text"
                        value="{$row.cosult_tel|htmlentities}">
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('View_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-view_num" disabled class="form-control" name="row[view_num]" type="number"
                        value="{$row.view_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Viewtime')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-viewtime" disabled class="form-control datetimepicker"
                        data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[viewtime]" type="text"
                        value="{:$row.viewtime?datetime($row.viewtime):''}">
                </div>
            </div>
        </div>

    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<!--定义模板-->
<script type="text/html" id="building_descripttpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="10">
        <input type="text" name="row[<%=value%>][<%=index%>][value]" class="form-control" value="<%=row['value']%>" size="10">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>
<script type="text/html" id="property_descripttpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="10">
        <input type="text" name="row[<%=value%>][<%=index%>][value]" class="form-control" value="<%=row['value']%>" size="10">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>